package com.jhinwins.equipmenteb.equipmentebserver.entity;

import com.jhinwins.equipmenteb.equipmentebserver.entity.common.GenerateId;
import org.springframework.beans.factory.annotation.Value;

import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "product_img")
public class ProductImgBean extends GenerateId {
    private String alt;
    private String imgUrl;
    private String picDir;

    public ProductImgBean(Long id) {
        super(id);
    }

    public ProductImgBean(String picDir) {
        this.picDir = picDir;
    }

    public ProductImgBean() {
    }

    public String getPicDir() {
        return picDir;
    }

    public void setPicDir(String picDir) {
        this.picDir = picDir;
    }

    public String getAlt() {
        return alt;
    }

    public void setAlt(String alt) {
        this.alt = alt;
    }

    public String getImgUrl() {
        // TODO: 2018/3/28 返回图片url应该在前面加上路径
        return picDir + "?picName=" + imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }
}
